package com.tarena.lbs.common.content.enums;

import lombok.Getter;

@Getter
public enum ArticeActionEnum {
    LIKE(1, "likeCount"),
    FAVORITE(2, "favoriteCount"),
    COMENET(3, "accessCount");

    private Integer code;
    private String msg;

    ArticeActionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMsgByCode(Integer code) {
        for (ArticeActionEnum articeActionEnum : ArticeActionEnum.values()) {
            if (articeActionEnum.getCode().equals(code)) {
                return articeActionEnum.getMsg();
            }
        }
        throw new RuntimeException("未找到对应 code 编码");
    }


}
